<template>
  <div>
    <van-nav-bar title="房屋管理" left-arrow @click-left="$router.go(-1)" />
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
      <ArticleItem v-for="item in list" :key="item.id" />
    </van-list>
  </div>
</template>

<script>
import ArticleItem from '@/components/ArticleItem.vue'
import { checkHouses } from '@/api/user'
export default {
  name: 'my_rent',
  data () {
    return {
      list: [],
      page: 1,
      loading: false,
      finished: false
    }
  },
  components: {
    ArticleItem
  },
  methods: {
    async onLoad () {
      // 获取出租房屋
      const { body } = await checkHouses()
      this.list = [...this.list, ...body]
      this.finished = true
      this.loading = true
    }
  }
}
</script>

<style scoped lang="less">
/deep/.van-nav-bar__content {
  background-color: #21b97a;

  .van-nav-bar__title {
    color: #fff;
    font-size: 18px;
  }
  .van-icon-arrow-left {
    color: #fff;
  }
}
</style>
